Optimal. Leaf size=404 \[ -\frac {B (b c-a d) g^3 n}{2 a c x}+A f^3 x-\frac {1}{2} B \left (\frac {b^2}{a^2}-\frac {d^2}{c^2}\right ) g^3 n \log (x)+\frac {b^2 B g^3 n \log (a+b x)}{2 a^2}-3 B f^2 g n \log (x) \log \left (1+\frac {b x}{a}\right )+\frac {B f^3 (a+b x) \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{b}-\frac {g^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{2 x^2}+\frac {3 (b c-a d) f g^2 (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{a (c+d x) \left (a-\frac {c (a+b x)}{c+d x}\right )}+3 f^2 g \log (x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )-\frac {B (b c-a d) f^3 n \log (c+d x)}{b d}-\frac {B d^2 g^3 n \log (c+d x)}{2 c^2}+3 B f^2 g n \log (x) \log \left (1+\frac {d x}{c}\right )+\frac {3 B (b c-a d) f g^2 n \log \left (a-\frac {c (a+b x)}{c+d x}\right )}{a c}-3 B f^2 g n \text {Li}_2\left (-\frac {b x}{a}\right )+3 B f^2 g n \text {Li}_2\left (-\frac {d x}{c}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.29, antiderivative size = 404, normalized size of antiderivative = 1.00, number of steps
used = 16, number of rules used = 10, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {2608, 2535,
31, 2547, 84, 2553, 2351, 2545, 2354, 2438} \begin {gather*} -3 B f^2 g n \text {PolyLog}\left (2,-\frac {b x}{a}\right )+3 B f^2 g n \text {PolyLog}\left (2,-\frac {d x}{c}\right )-\frac {1}{2} B g^3 n \log (x) \left (\frac {b^2}{a^2}-\frac {d^2}{c^2}\right )+\frac {b^2 B g^3 n \log (a+b x)}{2 a^2}+3 f^2 g \log (x) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )+\frac {3 f g^2 (a+b x) (b c-a d) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{a (c+d x) \left (a-\frac {c (a+b x)}{c+d x}\right )}-\frac {g^3 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{2 x^2}+\frac {B f^3 (a+b x) \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{b}-\frac {B f^3 n (b c-a d) \log (c+d x)}{b d}+\frac {3 B f g^2 n (b c-a d) \log \left (a-\frac {c (a+b x)}{c+d x}\right )}{a c}-\frac {B g^3 n (b c-a d)}{2 a c x}-3 B f^2 g n \log (x) \log \left (\frac {b x}{a}+1\right )+A f^3 x-\frac {B d^2 g^3 n \log (c+d x)}{2 c^2}+3 B f^2 g n \log (x) \log \left (\frac {d x}{c}+1\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 84
Rule 2351
Rule 2354
Rule 2438
Rule 2535
Rule 2545
Rule 2547
Rule 2553
Rule 2608
Rubi steps
\begin {align*} \int \left (f+\frac {g}{x}\right )^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \, dx &=\int \left (f^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )+\frac {g^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{x^3}+\frac {3 f g^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{x^2}+\frac {3 f^2 g \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{x}\right ) \, dx\\ &=f^3 \int \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \, dx+\left (3 f^2 g\right ) \int \frac {A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{x} \, dx+\left (3 f g^2\right ) \int \frac {A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{x^2} \, dx+g^3 \int \frac {A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{x^3} \, dx\\ &=A f^3 x-\frac {g^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{2 x^2}-\frac {3 f g^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{x}+3 f^2 g \log (x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )+\left (B f^3\right ) \int \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right ) \, dx-\left (3 B f^2 g n\right ) \int \frac {(c+d x) \left (-\frac {d (a+b x)}{(c+d x)^2}+\frac {b}{c+d x}\right ) \log (x)}{a+b x} \, dx+\left (3 B f g^2 n\right ) \int \frac {b c-a d}{x (a+b x) (c+d x)} \, dx+\frac {1}{2} \left (B g^3 n\right ) \int \frac {b c-a d}{x^2 (a+b x) (c+d x)} \, dx\\ &=A f^3 x+\frac {B f^3 (a+b x) \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{b}-\frac {g^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{2 x^2}-\frac {3 f g^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{x}+3 f^2 g \log (x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )-\frac {\left (B (b c-a d) f^3 n\right ) \int \frac {1}{c+d x} \, dx}{b}-\left (3 B f^2 g n\right ) \int \left (\frac {b \log (x)}{a+b x}-\frac {d \log (x)}{c+d x}\right ) \, dx+\left (3 B (b c-a d) f g^2 n\right ) \int \frac {1}{x (a+b x) (c+d x)} \, dx+\frac {1}{2} \left (B (b c-a d) g^3 n\right ) \int \frac {1}{x^2 (a+b x) (c+d x)} \, dx\\ &=A f^3 x+\frac {B f^3 (a+b x) \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{b}-\frac {g^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{2 x^2}-\frac {3 f g^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{x}+3 f^2 g \log (x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )-\frac {B (b c-a d) f^3 n \log (c+d x)}{b d}-\left (3 b B f^2 g n\right ) \int \frac {\log (x)}{a+b x} \, dx+\left (3 B d f^2 g n\right ) \int \frac {\log (x)}{c+d x} \, dx+\left (3 B (b c-a d) f g^2 n\right ) \int \left (\frac {1}{a c x}+\frac {b^2}{a (-b c+a d) (a+b x)}+\frac {d^2}{c (b c-a d) (c+d x)}\right ) \, dx+\frac {1}{2} \left (B (b c-a d) g^3 n\right ) \int \left (\frac {1}{a c x^2}+\frac {-b c-a d}{a^2 c^2 x}-\frac {b^3}{a^2 (-b c+a d) (a+b x)}-\frac {d^3}{c^2 (b c-a d) (c+d x)}\right ) \, dx\\ &=-\frac {B (b c-a d) g^3 n}{2 a c x}+A f^3 x+\frac {3 B (b c-a d) f g^2 n \log (x)}{a c}-\frac {B (b c-a d) (b c+a d) g^3 n \log (x)}{2 a^2 c^2}-\frac {3 b B f g^2 n \log (a+b x)}{a}+\frac {b^2 B g^3 n \log (a+b x)}{2 a^2}-3 B f^2 g n \log (x) \log \left (1+\frac {b x}{a}\right )+\frac {B f^3 (a+b x) \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{b}-\frac {g^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{2 x^2}-\frac {3 f g^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{x}+3 f^2 g \log (x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )-\frac {B (b c-a d) f^3 n \log (c+d x)}{b d}+\frac {3 B d f g^2 n \log (c+d x)}{c}-\frac {B d^2 g^3 n \log (c+d x)}{2 c^2}+3 B f^2 g n \log (x) \log \left (1+\frac {d x}{c}\right )+\left (3 B f^2 g n\right ) \int \frac {\log \left (1+\frac {b x}{a}\right )}{x} \, dx-\left (3 B f^2 g n\right ) \int \frac {\log \left (1+\frac {d x}{c}\right )}{x} \, dx\\ &=-\frac {B (b c-a d) g^3 n}{2 a c x}+A f^3 x+\frac {3 B (b c-a d) f g^2 n \log (x)}{a c}-\frac {B (b c-a d) (b c+a d) g^3 n \log (x)}{2 a^2 c^2}-\frac {3 b B f g^2 n \log (a+b x)}{a}+\frac {b^2 B g^3 n \log (a+b x)}{2 a^2}-3 B f^2 g n \log (x) \log \left (1+\frac {b x}{a}\right )+\frac {B f^3 (a+b x) \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{b}-\frac {g^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{2 x^2}-\frac {3 f g^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{x}+3 f^2 g \log (x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )-\frac {B (b c-a d) f^3 n \log (c+d x)}{b d}+\frac {3 B d f g^2 n \log (c+d x)}{c}-\frac {B d^2 g^3 n \log (c+d x)}{2 c^2}+3 B f^2 g n \log (x) \log \left (1+\frac {d x}{c}\right )-3 B f^2 g n \text {Li}_2\left (-\frac {b x}{a}\right )+3 B f^2 g n \text {Li}_2\left (-\frac {d x}{c}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.29, size = 336, normalized size = 0.83 \begin {gather*} A f^3 x+\frac {B f^3 (a+b x) \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{b}-\frac {g^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{2 x^2}-\frac {3 f g^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{x}+3 f^2 g \log (x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )-\frac {B (b c-a d) f^3 n \log (c+d x)}{b d}+\frac {3 B f g^2 n ((b c-a d) \log (x)-b c \log (a+b x)+a d \log (c+d x))}{a c}+\frac {B g^3 n \left (\left (-b^2 c^2 x+a^2 d^2 x\right ) \log (x)+b^2 c^2 x \log (a+b x)+a \left (-b c^2+a c d-a d^2 x \log (c+d x)\right )\right )}{2 a^2 c^2 x}-3 B f^2 g n \left (\log (x) \left (\log \left (1+\frac {b x}{a}\right )-\log \left (1+\frac {d x}{c}\right )\right )+\text {Li}_2\left (-\frac {b x}{a}\right )-\text {Li}_2\left (-\frac {d x}{c}\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.04, size = 0, normalized size = 0.00 \[\int \left (f +\frac {g}{x}\right )^{3} \left (A +B \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right )\right )\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int {\left (f+\frac {g}{x}\right )}^3\,\left (A+B\,\ln \left (e\,{\left (\frac {a+b\,x}{c+d\,x}\right )}^n\right )\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________